<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" aria-labelledby="createOrEditModal" class="modal fade"
    tabindex="-1" role="dialog" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <form *ngIf="active" #ObjForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <!-- <span>{{l("handle")}}{{l('messageRecord')}}</span> -->
                        <span *ngIf="objItem?.id">{{l("Edit")}}{{l("Course")}}:
                            {{objItem?.name}}</span>
                        <span *ngIf="!objItem?.id">{{l("Create")}}{{l("Course")}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" aria-label="Close">
                        <i aria-hidden="true" class="ki ki-close"></i>
                      </button> 
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="form-group col-6">
                            <label>{{l("Name")}}</label>
                            <input class="form-control" type="text" name="name" [(ngModel)]="objItem.name" required>
                        </div>
                        <div class="form-group col-6">
                            <label>{{l("itemId")}}</label>
                            <input class="form-control" type="text" name="courseNo" [(ngModel)]="objItem.courseNo" maxlength="32">
                        </div>
                        <div class="form-group col-12">
                            <label>{{l("tags")}}</label>
                            <p-autoComplete [(ngModel)]="tags" [suggestions]="tagSuggestion"
                                (completeMethod)="filter($event)" field="value" placeholder="tags"
                                dataKey="id" [multiple]="true" [dropdown]="true" (onSelect)="assignTags()"
                                (onUnselect)="assignTags()" (onBlur)="clearInput($event)" [minLength]="1"
                                name="MultiSelectInput" inputStyleClass="form-control" styleClass="width-percent-100">
                            </p-autoComplete>
                            <!-- <validation-messages [formCtrl]="nameInput"></validation-messages> -->
                        </div>
                        <div class="form-group col-12">
                            <label>{{l("description")}}</label>
                            <textarea class="form-control" name="description" [(ngModel)]="objItem.description"
                                style="height:100px !important;"></textarea>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-primary"
                        (click)="close()">{{l("Cancel")}}</button>
                    <button type="submit" class="btn btn-primary blue" [disabled]="!ObjForm.form.valid"
                        [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
                        <span>{{l("Save")}}</span></button>
                </div>
            </form>
        </div>
    </div>
</div>